home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / castools.zip / FUNC5H.ASM < prev    next >
Assembly Source File  |  1989-08-10  |  2KB  |  44 lines

  1. Include multi.inc
  2. Include model.inc
  3.  
  4. ;==============================================================================
  5. ;
  6. ;   CAS function 05h -- Find First Entry in Queue
  7. ;   
  8. ;   Format:
  9. ;               int CASFindFirst (int status, BYTE direction, BYTE queue)
  10. ;   Input:
  11. ;               Status of event, direction to search, queue to search
  12. ;   Output:
  13. ;               Returns event handle or negative error code
  14. ;==============================================================================
  15.  
  16.                 .CODE
  17. CASFindFirst    PROC    arg1:WORD, arg2:BYTE, arg3:BYTE 
  18.  
  19.                 push    bx              ; save registers
  20.                 push    cx              
  21.                 push    dx
  22.                 
  23.                 mov     ax,MUX          ; load multiplex number
  24.                 mov     ah,al           ; move into ah
  25.                 mov     al,05h          ; CAS function 5
  26.                 mov     cx,arg1         ; event status
  27.                 mov     dh,arg2         ; direction to search
  28.                 mov     dl,arg3         ; queue to search 
  29.                 int     2Fh
  30.  
  31.                 cmp     ax,0            ; ax = 0?
  32.                 jne     FINISH          ; find first failed, return err. code
  33.                 mov     ax,bx           ; move event handle to ax
  34. FINISH:                  
  35.                 pop     dx              ; restore registers
  36.                 pop     cx
  37.                 pop     bx        
  38.                 ret
  39. CASFindFirst    endp
  40.      
  41.                 END
  42.                 
  43.  
  44.